﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Tradex.Operations {

    /// <summary>
    /// The SecurityService handles all security related issues.
    /// </summary>
    public interface ISecurityService {

        /// <summary>
        /// Authenticates a user given his windows identity code only.
        /// </summary>
        /// <param name="windowsIdentity"></param>
        /// <returns></returns>
        PrincipalKey Authenticate(string windowsIdentity);

        /// <summary>
        /// Authenticates a user given a code and password.
        /// </summary>
        /// <param name="code"></param>
        /// <param name="password"></param>
        /// <returns></returns>
        PrincipalKey Authenticate(string code, string password);

        /// <summary>
        /// Returns the PrincipalInfo for a principal key.
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        PrincipalInfo GetPrincipalInfo(PrincipalKey key);

        /// <summary>
        /// Gets all registered permissions.
        /// </summary>
        /// <returns></returns>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")]
        IEnumerable<PermissionKey> GetPermissions();

    }

}
